package com.plugin.transformdemo;


import com.android.build.gradle.BaseExtension;

import org.gradle.api.Plugin;
import org.gradle.api.Project;

/**
 * 参照 : https://github.com/MichaelRocks/DataBindingCompat
 */
public class TransformDemoPlugin implements Plugin<Project> {
    static final String TAG = "任务TransformDemoPlugin:";
    public static void println(Object o) {
        System.out.println(TAG + o.toString());
    }
    @Override
    public void apply(Project project) {
        System.out.println("---------------apply TransformDemoPlugin------6------");
        BaseExtension appExtension = project.getExtensions().findByType(BaseExtension.class);
        println("extensionBase调试=" + appExtension);
        BaseExtension androidExtension = (BaseExtension) project.getExtensions().findByName("android");
        println("extensionAndroid调试=" + androidExtension);
        androidExtension.registerTransform(new TransformDemo(project));
    }
}
